const express = require('express')
const { upload } = require('./multer')

const main = express.Router()
main.post('/register', require('./user/register'))
main.post('/login', require('./user/login'))
// 用户管理
main.post('/userList/:operation', require('./user/userlist'))
// 日志管理
main.post('/log/:operation', require('./log/log'))
// 部门管理
main.post('/department/:operation', require('./department/department'))
// 审批管理
main.post('/approval/:operation', require('./approval/approval'))
// 通信记录管理
main.post('/communicationLog/:operation', require('./communicationLog/communicationLog'))
// 员工表
main.post('/employee/:operation', require('./employee/employee'))
// 位置信息
main.post('/location/:operation', require('./location/location'))
// 分配工单
main.post('/taskassignment/:operation', require('./taskassignment/taskassignment'))
// 分配工单
main.post('/workorder/:operation', require('./workorder/workorder'))
// 工单历史进度
main.post('/workorderhistory/:operation', require('./workorderhistory/workorderhistory'))
// 用户权限
main.post('/usertype/:operation', require('./usertype/usertype'))
// 数据分析与统计
main.post('/dataStatistics/:operation', require('./workOrderAnalysis/dataStatistics'))
// 操作日志
main.post('/message/:operation', require('./message/index'))
// 上传图片
main.post('/uploadFile', upload.single('file'), require('./uploadFile'))


// 创建一个路由测试一下
main.get('/index', (req, res) =>
{
    res.send('访问成功！')
})

// 导出
module.exports = main